package netty.rpc.core;

import io.netty.channel.ChannelFuture;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 服务请求连接持有者
 * @author Jim
 * @version 1.0.0
 * @descripition:
 * @date 2022/5/17 22:03
 */
public class NettyRpcServiceChannelFutureHolder {

    private static volatile Map<String, ChannelFuture> channelFutureMap = new ConcurrentHashMap<>();

    public static void put(String serviceName,ChannelFuture channelFuture){
        channelFutureMap.put(serviceName, channelFuture);
    }

    public static ChannelFuture get(String serviceName){
        return channelFutureMap.get(serviceName);
    }

}
